import request from '@/utils/request'

// 事业部列表
export function getDivisionList(query) {
  return request({
    url: '/tcm/agency/division/list',
    method: 'get',
    params: query
  })
}

// 新增事业部
export function addDivision(data) {
  return request({
    url: '/tcm/agency/division/add',
    method: 'post',
    data
  })
}

// 编辑事业部
export function updateDivision(data) {
  return request({
    url: '/tcm/agency/division/update',
    method: 'post',
    data
  })
}

// 获取事业部分润配置列表
export function getDivisionConfigList(query) {
  return request({
    url: '/tcm/agency/division/profit/list',
    method: 'get',
    params: query
  })
}

// 获取事业部分润配置列表
export function addDivisionProfit(data) {
  return request({
    url: '/tcm/agency/division/profit/add',
    method: 'post',
    data
  })
}

// 获取事业部分润配置列表
export function updateDivisionProfit(data) {
  return request({
    url: '/tcm/agency/division/profit/update',
    method: 'post',
    data
  })
}


// 我的服务商-渠道权限菜单
export function getCooperateList(query) {
  return request({
    url: '/tcm/agency/cooperate/company/list',
    method: 'get',
    params: query
  })
}

// 合作申请记录-渠道权限菜单
export function getApplyList(query) {
  return request({
    url: '/tcm/agency/cooperate/apply/list',
    method: 'get',
    params: query
  })
}

// 邀请服务商合作-渠道权限菜单
export function addApplyCooperate(data) {
  return request({
    url: '/tcm/agency/cooperate/apply/add',
    method: 'post',
    data
  })
}

// 审核申请记录
export function updateApplyCooperate(data) {
  return request({
    url: '/tcm/agency/cooperate/apply/update',
    method: 'post',
    data
  })
}

// 解除服务商合作
export function deleteApplyCooperate(data) {
  return request({
    url: '/tcm/agency/cooperate/delete',
    method: 'post',
    data
  })
}

// 我的渠道列表-服务商权限菜单
export function getChannelList(query) {
  return request({
    url: '/tcm/agency/cooperate/channel/list',
    method: 'get',
    params: query
  })
}

// 我的渠道列表-修改合作设置
export function updateCooperateSet(data) {
  return request({
    url: '/tcm/agency/cooperate/update',
    method: 'post',
    data
  })
}

// 获取登录用户所属事业部下面所有的服务商
export function getServiceCompanyList(query) {
  return request({
    url: '/company/company/service/company/list',
    method: 'get',
    params: query
  })
}

// 根据渠道ID获取服务商列表
export function cooperateCompanyLists(data) {
  return request({
    url: `/tcm/agency/cooperate/company/lists`,
    method: 'get',
    params: data
  })
}
